
#include "GWindow.h"
#include "GWindowMgr.h"

CGWindowMgr* CGWindowMgr::ms_pSingleton = NULL;

void CGWindowMgr::regWindow( CGWindow * pWindow )
{
	if ( pWindow )
	{
		m_listWindow.push_back( pWindow );
	}
}

void CGWindowMgr::advanceTime( float fElaspedTime )
{
	for ( int i=0; i< (int)m_listWindow.size(); i++)
	{
		m_listWindow[i]->advanceTime( fElaspedTime );
	}
}

CGWindow *CGWindowMgr::getWindow( GtkWidget *_pGw )
{
	for ( int i=0; i< (int)m_listWindow.size(); i++)
	{
		if ( m_listWindow[i]->isPari( _pGw ) )
			return m_listWindow[i];

	}
	return NULL;
}

